﻿* Encoding: UTF-8.

*********************************
Study 1
*********************************

*participants

FREQUENCIES sex. 
DESCRIPTIVES vars age.

*compute reactions to loss alone (loss) and loss to a third party (3p)*

compute jealous.loss=mean(Q45_2, q46_2).
compute jealous.loss3p=mean(Q47_2, q48_2).
RELIABILITY
  /VARIABLES=Q45_2, q46_2 Q47_2, q48_2
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute sad.loss=mean(Q45_5, q46_5).
compute sad.loss3p=mean(Q47_5, q48_5).
RELIABILITY
  /VARIABLES=Q45_5, q46_5 Q47_5, q48_5
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute angry.loss=mean(Q45_4, q46_4).
compute angry.loss3p=mean(Q47_4, q48_4).
EXECUTE.
RELIABILITY
  /VARIABLES=Q45_4, q46_4 Q47_4, q48_4
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*compute happy.loss=mean(q45_1, q46_1). 
*compute happy.loss3p=mean(q47_1, q48_1). 
*RELIABILITY
  /VARIABLES=Q45_1, q46_1 Q47_1, q48_1
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*compute pride.loss=mean(Q45_6, q46_6).
*compute pride.loss3p=mean(Q47_6, q48_6).
*EXECUTE.
*RELIABILITY
  /VARIABLES=Q45_6, q46_6 Q47_6, q48_6
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*compute disgust.loss=mean(Q45_3, q46_3).
*compute disgust.loss3p=mean(Q47_3, q48_3).
*EXECUTE.
*RELIABILITY
  /VARIABLES=Q45_5, q46_5 Q47_5, q48_5
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*focal ANOVA [loss alone, loss to third party] x [reactions]

GLM jealous.loss sad.loss angry.loss jealous.loss3p sad.loss3p angry.loss3p
  /WSFACTOR=lossalone_loss3p 2 Polynomial reaction 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(reaction*lossalone_loss3p lossalone_loss3p*reaction)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(lossalone_loss3p) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(reaction) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(lossalone_loss3p*reaction) compare (reaction)
  /EMMEANS=TABLES(lossalone_loss3p*reaction) compare (lossalone_loss3p)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=lossalone_loss3p reaction lossalone_loss3p*reaction.


*for Table S1
GLM jealous.loss sad.loss angry.loss happy.loss disgust.loss pride.loss 
jealous.loss3p sad.loss3p angry.loss3p happy.loss3p disgust.loss3p pride.loss3p
  /WSFACTOR=lossalone_loss3p 2 Polynomial reaction 6 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(reaction*lossalone_loss3p)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(lossalone_loss3p) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(reaction) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(lossalone_loss3p*reaction) compare (reaction)
  /EMMEANS=TABLES(lossalone_loss3p*reaction) compare (lossalone_loss3p)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=lossalone_loss3p reaction lossalone_loss3p*reaction.


*********************************
Study 2
*********************************

use all.
FREQUENCIES sex.
DESCRIPTIVES vars age. 

*Included participants passing two early data checks*

USE ALL.
COMPUTE filter_$=(pass=1 & attn2=4 ).
VARIABLE LABELS filter_$ 'pass=1 & attn2=4  (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.
DESCRIPTIVES vars age. 


*compute conditions

recode thirdparty (1=1) into lossalone_control_thirdparty.
recode lossalone (1=-1) into lossalone_control_thirdparty.
recode control (1=0) into lossalone_control_thirdparty.
EXECUTE.
FREQUENCIES lossalone_control_thirdparty.


**for comparions following omnibus test

recode thirdparty (1=1) into control_thirdparty.
recode control (1=0) into control_thirdparty.
recode lossalone (1=1) into control_lossalone.
recode control (1=0) into control_lossalone.
recode thirdparty (1=0) into thirdparty_lossalone.
recode lossalone (1=1) into thirdparty_lossalone.
EXECUTE.
*EXECUTE.


*compute reaction outcomes

compute bfloss3p_jeal =mean(Q26_1, Q28_1).
RELIABILITY
  /VARIABLES=Q26_1, Q28_1 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss3p_anger =mean(Q26_2, Q28_2).
RELIABILITY
  /VARIABLES=Q26_2, Q28_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss3p_sad =mean(Q26_3, Q28_3).
RELIABILITY
  /VARIABLES=Q26_3, Q28_3 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss3p_proud =mean(Q26_4, Q28_4).
RELIABILITY
  /VARIABLES=Q26_3, Q28_3
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss3p_afraid=mean(Q26_5, Q28_5).
RELIABILITY
  /VARIABLES=Q26_5, Q28_5 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss3p_pity =mean(Q26_6, Q28_6).
RELIABILITY
  /VARIABLES=Q26_6, Q28_6 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
EXECUTE.

compute bfloss_jeal =mean(Q22_1.0, Q24_1.0).
RELIABILITY
  /VARIABLES=Q22_1.0, Q24_1.0 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss_anger =mean(Q22_2.0, Q24_2.0).
RELIABILITY
  /VARIABLES=Q22_2.0, Q24_2.0 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss_sad =mean(Q22_3.0, Q24_3.0).
RELIABILITY
  /VARIABLES=Q22_3.0, Q24_3.0 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss_proud =mean(Q22_4.0, Q24_4.0).
RELIABILITY
  /VARIABLES=Q22_4.0, Q24_4.0 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss_afraid=mean(Q22_5.0, Q24_5.0).
RELIABILITY
  /VARIABLES=Q22_5.0, Q24_5.0 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfloss_pity =mean(Q22_6.0, Q24_6.0).
RELIABILITY
  /VARIABLES=Q22_6.0, Q24_6.0 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
EXECUTE.

compute jealous=sum(bfloss3p_jeal, bfloss_jeal). 
compute anger =sum(bfloss3p_anger, bfloss_anger). 
compute sadness=sum(bfloss3p_sad, bfloss_sad). 
compute proud=sum(bfloss3p_proud, bfloss_proud). 
compute afraid =sum(bfloss3p_afraid, bfloss_afraid). 
compute pity=sum(bfloss3p_pity, bfloss_pity). 
EXECUTE.


*compute friendship maintenance types

**friend guarding-vigilance

compute vigilance_3p=mean(VIGILANCE1_3P, VIGILANCE2_3P). 
compute vigilance_control=mean(VIGILANCE1, VIGILANCE2).
compute vigilance_loss=mean(VIGILANCE1_la, VIGILANCE2_la). 
compute vigilance_overall=sum(vigilance_3p, vigilance_control, vigilance_loss). 
DESCRIPTIVES vars vigilance_3p vigilance_control, vigilance_loss.
RELIABILITY
  /VARIABLES=VIGILANCE1_3P, VIGILANCE2_3P
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=VIGILANCE1, VIGILANCE2
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=VIGILANCE1_la, VIGILANCE2_la
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

**everyday friend retention types and aggregate

compute bepositive_3p=mean(retain13p).
compute bepositive_control=mean(retain1).
compute bepositive_loss=mean(retain1_la).
compute bepositive_overall=sum(bepositive_3p, bepositive_control, bepositive_loss).
DESCRIPTIVES vars bepositive_3p, bepositive_control, bepositive_loss.
EXECUTE.

compute beopen_3p=mean(retain23p, retain33p, retain43p).
compute beopen_control=mean(retain2, retain3, retain4).
compute beopen_loss=mean(retain2_la, retain3_la, retain4_la).
compute beopen_overall=sum(beopen_3p, beopen_control, beopen_loss).
DESCRIPTIVES vars beopen_3p, beopen_control, beopen_loss.
EXECUTE.
RELIABILITY
  /VARIABLES=retain23p, retain33p, retain43p
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=retain2, retain3, retain4
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=retain2_la, retain3_la, retain4_la
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute assurances_3p=mean(retain53p).
compute assurances_control=mean(retain5).
compute assurances_loss=mean(retain5_la).
compute assurances_overall=sum(assurances_3p, assurances_control, assurances_loss).
DESCRIPTIVES vars assurances_3p, assurances_control, assurances_loss.
EXECUTE.

compute socialnetworks_3p=mean(retain63p).
compute socialnetworks_control=mean(retain6).
compute socialnetworks_loss=mean(retain6_la).
compute socialnetworks_overall=sum(socialnetworks_3p, socialnetworks_control, socialnetworks_loss).
EXECUTE.

compute avoidance_3p=mean(retain73p, retain83p).
compute avoidance_control=mean(retain7, retain8).
compute avoidance_loss=mean(retain7_la, retain8_la).
compute avoidance_overall=sum(avoidance_3p, avoidance_control, avoidance_loss).
DESCRIPTIVES vars avoidance_3p, avoidance_control, avoidance_loss.
EXECUTE.
RELIABILITY
  /VARIABLES=retain73p, retain83p
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=retain7, retain8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=retain7_la, retain8_la
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute humor_3p=mean(retain93p).
compute humor_control=mean(retain9).
compute humor_loss=mean(retain9_la).
compute humor_overall=sum(humor_3p, humor_control, humor_loss).
DESCRIPTIVES vars humor_3p, humor_control, humor_loss.
EXECUTE.

compute everydayfr=mean(bepositive_overall, beopen_overall, assurances_overall, socialnetworks_overall, avoidance_overall, humor_overall).
EXECUTE.
RELIABILITY
  /VARIABLES=bepositive_overall, beopen_overall, assurances_overall, socialnetworks_overall, avoidance_overall, humor_overall
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.


*focal ANOVA: reactions

GLM jealous anger sadness  BY thirdparty_lossalone
  /WSFACTOR=emotions 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(emotions*thirdparty_lossalone thirdparty_lossalone*emotions)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(emotions) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(thirdparty_lossalone) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(thirdparty_lossalone*emotions) compare (emotions)
  /EMMEANS=TABLES(thirdparty_lossalone*emotions) compare (thirdparty_lossalone)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=emotions 
  /DESIGN=thirdparty_lossalone.

*all reactions for the Table in the SOM
*GLM jealous  sadness anger proud afraid pity BY thirdparty_lossalone
  /WSFACTOR=emotions 6 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(emotions*thirdparty_lossalone thirdparty_lossalone*emotions)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(emotions) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(thirdparty_lossalone) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(thirdparty_lossalone*emotions) compare (emotions)
  /EMMEANS=TABLES(thirdparty_lossalone*emotions) compare (thirdparty_lossalone)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=emotions 
  /DESIGN=thirdparty_lossalone.


*focal ANOVA friend retention
*omnibus

GLM vigilance_overall everydayfr BY lossalone_control_thirdparty
  /WSFACTOR=guardingtactics 2  Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(guardingtactics*lossalone_control_thirdparty lossalone_control_thirdparty*guardingtactics)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(lossalone_control_thirdparty) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(guardingtactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(lossalone_control_thirdparty*guardingtactics)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=guardingtactics 
  /DESIGN=lossalone_control_thirdparty.

*for comparisons

GLM vigilance_overall everydayfr BY control_thirdparty
  /WSFACTOR=guardingtactics 2  Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(control_thirdparty*guardingtactics) compare (control_thirdparty)
  /EMMEANS=TABLES(control_thirdparty*guardingtactics) compare (guardingtactics)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=guardingtactics 
  /DESIGN=control_thirdparty.
GLM vigilance_overall everydayfr BY thirdparty_lossalone
  /WSFACTOR=guardingtactics 2  Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(thirdparty_lossalone*guardingtactics) compare (thirdparty_lossalone)
  /EMMEANS=TABLES(thirdparty_lossalone*guardingtactics) compare (guardingtactics)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=guardingtactics 
  /DESIGN=thirdparty_lossalone.
GLM vigilance_overall everydayfr BY control_lossalone
  /WSFACTOR=guardingtactics 2  Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(control_lossalone*guardingtactics) compare (control_lossalone)
  /EMMEANS=TABLES(control_lossalone*guardingtactics) compare (guardingtactics)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=guardingtactics 
  /DESIGN=control_lossalone.

*For the Table in the SOM 
*GLM vigilance_overall bepositive_overall beopen_overall assurances_overall 
socialnetworks_overall avoidance_overall humor_overall BY lossalone_control_thirdparty
  /WSFACTOR=guardingtactics 7  Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(guardingtactics*lossalone_control_thirdparty lossalone_control_thirdparty*guardingtactics)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(lossalone_control_thirdparty) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(guardingtactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(lossalone_control_thirdparty*guardingtactics) compare (lossalone_control_thirdparty)
  /EMMEANS=TABLES(lossalone_control_thirdparty*guardingtactics) compare (guardingtactics)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=guardingtactics 
  /DESIGN=lossalone_control_thirdparty.


*Mediation PROCESS Model 4: Mediation for friend guarding - vigilance
X (thirdparty_lossalone)
M jealousy sadness anger
Y vigilance_overall


*********************************
Study 3a
*********************************

*participants

FREQUENCIES sex. 
DESCRIPTIVES vars age.

*omnibus ANOVA for friendship jealousy


GLM acqstranger_3 cfstranger_3 bfstranger_3  bfcf_3 bfnewmate_3 
  /WSFACTOR=relationships 5 Polynomial
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*ANOVA with all reactions (Table S4)
GLM acqstranger_3 acqstranger_7 acqstranger_5  acqstranger_2 acqstranger_11 acqstranger_1 acqstranger_4 acqstranger_6
 acqstranger_8 acqstranger_9 acqstranger_12 acqstranger_10
cfstranger_3 cfstranger_7 cfstranger_5 cfstranger_2 cfstranger_11 cfstranger_1 cfstranger_4 cfstranger_6
 cfstranger_8 cfstranger_9 cfstranger_12 cfstranger_10
bfstranger_3  bfstranger_7 bfstranger_5 bfstranger_2 bfstranger_11 bfstranger_1 bfstranger_4 bfstranger_6
 bfstranger_8 bfstranger_9 bfstranger_12 bfstranger_10
bfcf_3 bfcf_7 bfcf_5 bfcf_2 bfcf_11 bfcf_1 bfcf_4 bfcf_6 bfcf_8 bfcf_9 bfcf_12 bfcf_10
bfnewmate_3 bfnewmate_7 bfnewmate_5 bfnewmate_2 bfnewmate_11 bfnewmate_1 bfnewmate_4 bfnewmate_6
 bfnewmate_8 bfnewmate_9 bfnewmate_12 bfnewmate_10
  /WSFACTOR=relationships 5 Polynomial emotion 5 polynomial
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships*emotion)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships*emotion.




**FRIEND GUARDING computations

*****best friend + same-sex stranger.


*vigilance

RELIABILITY
  /VARIABLES=bussbf_1 bussbf_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute vigilance=mean(bussbf_1 , bussbf_2 ).

*separation

RELIABILITY
  /VARIABLES=bussbf_3 bussbf_4 bussbf_5  bussbf_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute separation=mean(bussbf_3 ,bussbf_4 ,bussbf_5 , bussbf_8).
EXECUTE.

*monopolization

RELIABILITY
  /VARIABLES=bussbf_6 bussbf_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute monopolization=mean(bussbf_6 ,bussbf_7).

*make jealous

RELIABILITY
  /VARIABLES= bussbf_9 
    bussbf_10 bussbf_11 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute makejealousy=mean(bussbf_9 ,bussbf_10 ,bussbf_11 ).
    

*punish

RELIABILITY
  /VARIABLES=bussbf_12 bussbf_13 bussbf_14 bussbf_15
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute punish =mean(bussbf_12, bussbf_13, bussbf_14, bussbf_15).

*emo manipulation

RELIABILITY
  /VARIABLES=   bussbf_16 bussbf_17 bussbf_18 bussbf_19 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute emotionalmanip=mean(bussbf_16, bussbf_17, bussbf_18 ,bussbf_19).

*derogate rival

RELIABILITY
  /VARIABLES=     bussbf_20  bussbf_21 bussbf_22 bussbf_23 bussbf_24 bussbf_25 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute deorgaterival=mean(bussbf_20  ,bussbf_21 ,bussbf_22, bussbf_23, bussbf_24, bussbf_25).


*self/commitment enhancements

RELIABILITY
  /VARIABLES= bussbf_26  bussbf_27 bussbf_28 bussbf_29 
    bussbf_30 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute enhancement=mean(bussbf_26,  bussbf_27, bussbf_28, bussbf_29, bussbf_30 ).

*possession

RELIABILITY
  /VARIABLES=bussbf_31 bussbf_32 bussbf_33 bussbf_34 bussbf_35 bussbf_36 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute possession=mean(bussbf_31, bussbf_32, bussbf_33, bussbf_34, bussbf_35, bussbf_36).


*derogate friend

RELIABILITY
  /VARIABLES= bussbf_37 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute derogatefriend=mean(bussbf_37).

*direct aggression 

RELIABILITY
  /VARIABLES= bussbf_38  bussbf_41 bussbf_42 bussbf_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute directagg=mean(bussbf_38,  bussbf_41 ,bussbf_42, bussbf_44).

*indirect aggression 

RELIABILITY
  /VARIABLES= bussbf_39 
    bussbf_40 bussbf_43 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute indirectagg=mean(bussbf_39 , bussbf_40 ,bussbf_43 ).

compute overallbf_friendguard=mean(
bussbf_1, bussbf_2 ,bussbf_3 ,bussbf_4, bussbf_5, bussbf_6, bussbf_7, bussbf_8, bussbf_9, 
    bussbf_10, bussbf_11, bussbf_12 ,bussbf_13, bussbf_14 ,bussbf_15 ,bussbf_16, bussbf_17
, bussbf_18, bussbf_19 ,
    bussbf_20, bussbf_21, bussbf_22, bussbf_23, bussbf_24, bussbf_25, bussbf_26,
 bussbf_27, bussbf_28, bussbf_29 ,
    bussbf_30 ,bussbf_31, bussbf_32, bussbf_33, bussbf_34, bussbf_35, bussbf_36,
 bussbf_37, bussbf_38, bussbf_39 ,
    bussbf_40, bussbf_41, bussbf_42, bussbf_43, bussbf_44).
EXECUTE.
RELIABILITY
  /VARIABLES=bussbf_1 bussbf_2 bussbf_3 bussbf_4 bussbf_5 bussbf_6 bussbf_7 bussbf_8 bussbf_9 
    bussbf_10 bussbf_11 bussbf_12 bussbf_13 bussbf_14 bussbf_15 bussbf_16 bussbf_17 bussbf_18 bussbf_19 
    bussbf_20 bussbf_21 bussbf_22 bussbf_23 bussbf_24 bussbf_25 bussbf_26 bussbf_27 bussbf_28 bussbf_29 
    bussbf_30 bussbf_31 bussbf_32 bussbf_33 bussbf_34 bussbf_35 bussbf_36 bussbf_37 bussbf_38 bussbf_39 
    bussbf_40 bussbf_41 bussbf_42 bussbf_43 bussbf_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.



*****best friend + own close friend 

*vigilance

RELIABILITY
  /VARIABLES=q80_1 q80_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.vigilance=mean(q80_1 , q80_2 ).

*separation

RELIABILITY
  /VARIABLES=q80_3 q80_4 q80_5  q80_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute bfcf.separation=mean(q80_3 ,q80_4 ,q80_5 , q80_8).
EXECUTE.

*monopolization

RELIABILITY
  /VARIABLES=q80_6 q80_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.monopolization=mean(q80_6 ,q80_7).

*make jealous

RELIABILITY
  /VARIABLES= q80_9 
    q80_10 q80_11 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.makejealousy=mean(q80_9 ,q80_10 ,q80_11 ).
    

*punish

RELIABILITY
  /VARIABLES=q80_12 q80_13 q80_14 q80_15
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.punish =mean(q80_12, q80_13, q80_14, q80_15).

*emo manipulation

RELIABILITY
  /VARIABLES=   q80_16 q80_17 q80_18 q80_19 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute bfcf.emotionalmanip=mean(q80_16, q80_17, q80_18 ,q80_19).

*derogate rival

RELIABILITY
  /VARIABLES=     q80_20  q80_21 q80_22 q80_23 q80_24 q80_25 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.deorgaterival=mean(q80_20  ,q80_21 ,q80_22, q80_23, q80_24, q80_25).


*self/commitment enhancements

RELIABILITY
  /VARIABLES= q80_26  q80_27 q80_28 q80_29 
    q80_30 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute bfcf.enhancement=mean(q80_26,  q80_27, q80_28, q80_29, q80_30 ).

*possession

RELIABILITY
  /VARIABLES=q80_31 q80_32 q80_33 q80_34 q80_35 q80_36 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.possession=mean(q80_31, q80_32, q80_33, q80_34, q80_35, q80_36).


*derogate friend

RELIABILITY
  /VARIABLES= q80_37 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.derogatefriend=mean(q80_37).

*direct aggression 

RELIABILITY
  /VARIABLES= q80_38  q80_41 q80_42 q80_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.directagg=mean(q80_38,  q80_41 ,q80_42, q80_44).


*indirect aggression 

RELIABILITY
  /VARIABLES= q80_39 
    q80_40 q80_43 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfcf.indirectagg=mean(q80_39 , q80_40 ,q80_43 ).

compute overallbfcf_friendguard=mean(
q80_1, q80_2 ,q80_3 ,q80_4, q80_5, q80_6, q80_7, q80_8, q80_9, 
    q80_10, q80_11, q80_12 ,q80_13, q80_14 ,q80_15 ,q80_16, q80_17
, q80_18, q80_19 ,
    q80_20, q80_21, q80_22, q80_23, q80_24, q80_25, q80_26,
 q80_27, q80_28, q80_29 ,
    q80_30 ,q80_31, q80_32, q80_33, q80_34, q80_35, q80_36,
 q80_37, q80_38, q80_39 ,
    q80_40, q80_41, q80_42, q80_43, q80_44).
EXECUTE.



*****best friend + romantic partner

*vigilance

RELIABILITY
  /VARIABLES=q137_1 q137_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.vigilance=mean(q137_1 , q137_2 ).

*separation

RELIABILITY
  /VARIABLES=q137_3 q137_4 q137_5  q137_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute bfrom.separation=mean(q137_3 ,q137_4 ,q137_5 , q137_8).
EXECUTE.

*monopolization

RELIABILITY
  /VARIABLES=q137_6 q137_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.monopolization=mean(q137_6 ,q137_7).

*make jealous

RELIABILITY
  /VARIABLES= q137_9 
    q137_10 q137_11 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.makejealousy=mean(q137_9 ,q137_10 ,q137_11 ).
    

*punish

RELIABILITY
  /VARIABLES=q137_12 q137_13 q137_14 q137_15
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.punish =mean(q137_12, q137_13, q137_14, q137_15).

*emo manipulation

RELIABILITY
  /VARIABLES=   q137_16 q137_17 q137_18 q137_19 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute bfrom.emotionalmanip=mean(q137_16, q137_17, q137_18 ,q137_19).

*derogate rival

RELIABILITY
  /VARIABLES=     q137_20  q137_21 q137_22 q137_23 q137_24 q137_25 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.deorgaterival=mean(q137_20  ,q137_21 ,q137_22, q137_23, q137_24, q137_25).


*self/commitment enhancements

RELIABILITY
  /VARIABLES= q137_26  q137_27 q137_28 q137_29 
    q137_30 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute bfrom.enhancement=mean(q137_26,  q137_27, q137_28, q137_29, q137_30 ).

*possession

RELIABILITY
  /VARIABLES=q137_31 q137_32 q137_33 q137_34 q137_35 q137_36 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.possession=mean(q137_31, q137_32, q137_33, q137_34, q137_35, q137_36).


*derogate friend

RELIABILITY
  /VARIABLES= q137_37 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.derogatefriend=mean(q137_37).

*aggression 

RELIABILITY
  /VARIABLES= q137_38 q137_39 
    q137_40 q137_41 q137_42 q137_43 q137_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*direct aggression 

RELIABILITY
  /VARIABLES= q137_38  q137_41 q137_42 q137_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.directagg=mean(q137_38,  q137_41 ,q137_42, q137_44).


*indirect aggression 

RELIABILITY
  /VARIABLES= q137_39 
    q137_40 q137_43 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute bfrom.indirectagg=mean(q137_39 , q137_40 ,q137_43 ).


compute overallbfrom_friendguard=mean(
q137_1, q137_2 ,q137_3 ,q137_4, q137_5, q137_6, q137_7, q137_8, q137_9, 
    q137_10, q137_11, q137_12 ,q137_13, q137_14 ,q137_15 ,q137_16, q137_17
, q137_18, q137_19 ,
    q137_20, q137_21, q137_22, q137_23, q137_24, q137_25, q137_26,
 q137_27, q137_28, q137_29 ,
    q137_30 ,q137_31, q137_32, q137_33, q137_34, q137_35, q137_36,
 q137_37, q137_38, q137_39 ,
    q137_40, q137_41, q137_42, q137_43, q137_44).
EXECUTE.


*analysis
*does friendship jealousy over best friend + others (stranger, own friend, partner) predict friend guarding vs. those otherss?

compute aggregatedjealousy_versusALL=mean(bfstranger_3,  bfcf_3, bfnewmate_3).
RELIABILITY
  /VARIABLES=bfstranger_3,  bfcf_3 bfnewmate_3
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute aggregatedguarding_versusALL=mean(
q80_1, q80_2 ,q80_3 ,q80_4, q80_5, q80_6, q80_7, q80_8, q80_9, 
    q80_10, q80_11, q80_12 ,q80_13, q80_14 ,q80_15 ,q80_16, q80_17
, q80_18, q80_19 ,
    q80_20, q80_21, q80_22, q80_23, q80_24, q80_25, q80_26,
 q80_27, q80_28, q80_29 ,
    q80_30 ,q80_31, q80_32, q80_33, q80_34, q80_35, q80_36,
 q80_37, q80_38, q80_39 ,
    q80_40, q80_41, q80_42, q80_43, q80_44, bussbf_1, bussbf_2 ,bussbf_3 ,bussbf_4, bussbf_5, bussbf_6, bussbf_7, bussbf_8, bussbf_9, 
    bussbf_10, bussbf_11, bussbf_12 ,bussbf_13, bussbf_14 ,bussbf_15 ,bussbf_16, bussbf_17
, bussbf_18, bussbf_19 ,
    bussbf_20, bussbf_21, bussbf_22, bussbf_23, bussbf_24, bussbf_25, bussbf_26,
 bussbf_27, bussbf_28, bussbf_29 ,
    bussbf_30 ,bussbf_31, bussbf_32, bussbf_33, bussbf_34, bussbf_35, bussbf_36,
 bussbf_37, bussbf_38, bussbf_39 ,
    bussbf_40, bussbf_41, bussbf_42, bussbf_43, bussbf_44, q137_1, q137_2 ,q137_3 ,q137_4, q137_5, q137_6, q137_7, q137_8, q137_9, 
    q137_10, q137_11, q137_12 ,q137_13, q137_14 ,q137_15 ,q137_16, q137_17
, q137_18, q137_19 ,
    q137_20, q137_21, q137_22, q137_23, q137_24, q137_25, q137_26,
 q137_27, q137_28, q137_29 ,
    q137_30 ,q137_31, q137_32, q137_33, q137_34, q137_35, q137_36,
 q137_37, q137_38, q137_39 ,
    q137_40, q137_41, q137_42, q137_43, q137_44).
EXECUTE.
RELIABILITY
  /VARIABLES=q80_1, q80_2 ,q80_3 ,q80_4, q80_5, q80_6, q80_7, q80_8, q80_9, 
    q80_10, q80_11, q80_12 ,q80_13, q80_14 ,q80_15 ,q80_16, q80_17
, q80_18, q80_19 ,
    q80_20, q80_21, q80_22, q80_23, q80_24, q80_25, q80_26,
 q80_27, q80_28, q80_29 ,
    q80_30 ,q80_31, q80_32, q80_33, q80_34, q80_35, q80_36,
 q80_37, q80_38, q80_39 ,
    q80_40, q80_41, q80_42, q80_43, q80_44, bussbf_1, bussbf_2 ,bussbf_3 ,bussbf_4, bussbf_5, bussbf_6, bussbf_7, bussbf_8, bussbf_9, 
    bussbf_10, bussbf_11, bussbf_12 ,bussbf_13, bussbf_14 ,bussbf_15 ,bussbf_16, bussbf_17
, bussbf_18, bussbf_19 ,
    bussbf_20, bussbf_21, bussbf_22, bussbf_23, bussbf_24, bussbf_25, bussbf_26,
 bussbf_27, bussbf_28, bussbf_29 ,
    bussbf_30 ,bussbf_31, bussbf_32, bussbf_33, bussbf_34, bussbf_35, bussbf_36,
 bussbf_37, bussbf_38, bussbf_39 ,
    bussbf_40, bussbf_41, bussbf_42, bussbf_43, bussbf_44, q137_1, q137_2 ,q137_3 ,q137_4, q137_5, q137_6, q137_7, q137_8, q137_9, 
    q137_10, q137_11, q137_12 ,q137_13, q137_14 ,q137_15 ,q137_16, q137_17
, q137_18, q137_19 ,
    q137_20, q137_21, q137_22, q137_23, q137_24, q137_25, q137_26,
 q137_27, q137_28, q137_29 ,
    q137_30 ,q137_31, q137_32, q137_33, q137_34, q137_35, q137_36,
 q137_37, q137_38, q137_39 ,
    q137_40, q137_41, q137_42, q137_43, q137_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
CORRELATIONS
  /VARIABLES=aggregatedjealousy_versusALL aggregatedguarding_versusALL
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.


*Do friend-guarding intentions vary in accordance with predictions? 
*(factor1=interloper: same-sex stranger, same-sex bf, other-sex romantic partner)

GLM vigilance separation monopolization makejealousy punish emotionalmanip deorgaterival 
    enhancement possession derogatefriend directagg indirectagg 
bfcf.vigilance bfcf.separation 
    bfcf.monopolization bfcf.makejealousy bfcf.punish bfcf.emotionalmanip bfcf.deorgaterival 
    bfcf.enhancement bfcf.possession bfcf.derogatefriend bfcf.directagg bfcf.indirectagg 
    bfrom.vigilance bfrom.separation 
bfrom.monopolization bfrom.makejealousy bfrom.punish 
    bfrom.emotionalmanip bfrom.deorgaterival bfrom.enhancement bfrom.possession bfrom.derogatefriend 
    bfrom.directagg bfrom.indirectagg
  /WSFACTOR=factor1 3 Polynomial subscales 12 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(factor1 subscales*factor1)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(factor1) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(subscales) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(factor1*subscales) compare(factor1)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=factor1 subscales factor1*subscales.


*For MEMORE (within-subjects mediation)
*Test #1

*compure aggregate for friendship jealousy versus same-sex others (stranger, own close friend)

compute aggregatedjealousy_versusfriends=mean(bfstranger_3,  bfcf_3).
RELIABILITY
  /VARIABLES=bfstranger_3,  bfcf_3
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute aggregatedguarding_versusfriends=mean(
q80_1, q80_2 ,q80_3 ,q80_4, q80_5, q80_6, q80_7, q80_8, q80_9, 
    q80_10, q80_11, q80_12 ,q80_13, q80_14 ,q80_15 ,q80_16, q80_17
, q80_18, q80_19 ,
    q80_20, q80_21, q80_22, q80_23, q80_24, q80_25, q80_26,
 q80_27, q80_28, q80_29 ,
    q80_30 ,q80_31, q80_32, q80_33, q80_34, q80_35, q80_36,
 q80_37, q80_38, q80_39 ,
    q80_40, q80_41, q80_42, q80_43, q80_44, bussbf_1, bussbf_2 ,bussbf_3 ,bussbf_4, bussbf_5, bussbf_6, bussbf_7, bussbf_8, bussbf_9, 
    bussbf_10, bussbf_11, bussbf_12 ,bussbf_13, bussbf_14 ,bussbf_15 ,bussbf_16, bussbf_17
, bussbf_18, bussbf_19 ,
    bussbf_20, bussbf_21, bussbf_22, bussbf_23, bussbf_24, bussbf_25, bussbf_26,
 bussbf_27, bussbf_28, bussbf_29 ,
    bussbf_30 ,bussbf_31, bussbf_32, bussbf_33, bussbf_34, bussbf_35, bussbf_36,
 bussbf_37, bussbf_38, bussbf_39 ,
    bussbf_40, bussbf_41, bussbf_42, bussbf_43, bussbf_44).
EXECUTE.
RELIABILITY
  /VARIABLES=q80_1, q80_2 ,q80_3 ,q80_4, q80_5, q80_6, q80_7, q80_8, q80_9, 
    q80_10, q80_11, q80_12 ,q80_13, q80_14 ,q80_15 ,q80_16, q80_17
, q80_18, q80_19 ,
    q80_20, q80_21, q80_22, q80_23, q80_24, q80_25, q80_26,
 q80_27, q80_28, q80_29 ,
    q80_30 ,q80_31, q80_32, q80_33, q80_34, q80_35, q80_36,
 q80_37, q80_38, q80_39 ,
    q80_40, q80_41, q80_42, q80_43, q80_44, bussbf_1, bussbf_2 ,bussbf_3 ,bussbf_4, bussbf_5, bussbf_6, bussbf_7, bussbf_8, bussbf_9, 
    bussbf_10, bussbf_11, bussbf_12 ,bussbf_13, bussbf_14 ,bussbf_15 ,bussbf_16, bussbf_17
, bussbf_18, bussbf_19 ,
    bussbf_20, bussbf_21, bussbf_22, bussbf_23, bussbf_24, bussbf_25, bussbf_26,
 bussbf_27, bussbf_28, bussbf_29 ,
    bussbf_30 ,bussbf_31, bussbf_32, bussbf_33, bussbf_34, bussbf_35, bussbf_36,
 bussbf_37, bussbf_38, bussbf_39 ,
    bussbf_40, bussbf_41, bussbf_42, bussbf_43, bussbf_44
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*MEMORE TEST 1
M variables: aggregatedjealousy_versusfriends (shortname = ajvf) bfnewmate_3 (shortname=bfnm3)
Y variables: aggregatedguarding_versusfriends (shortname = agvf) overallbfrom_friendguard (shortname = fgvsrom)


*MEMORE TEST 2
*Test #2: Parallel multiple mediation

compute aggregatedsadness_versusfriends=mean(bfstranger_7,  bfcf_7).
compute aggregatedanger_versusfriends=mean(bfstranger_5,  bfcf_5).
EXECUTE.
compute  aavf = 1*aggregatedanger_versusfriends.
compute  asvf = 1*aggregatedsadness_versusfriends.
compute bfnm5= 1*bfnewmate_5.
compute bfnm7= 1*bfnewmate_7.
EXECUTE.

*
M variables: aggregatedjealousy_versusfriends (shortname = ajvf) bfnewmate_3 (shortname=bfnm3)
aggregatedsadness_versusfriends (shortname = asvf) bfnewmate_7 (shortname = bfnm7) 
aggregatedanger_versusfriends (shortname = aavf) bfnewmate_5 (shortname = bfnm5) 
Y variables: aggregatedguarding_versusfriends (shortname = agvf) overallbfrom_friendguard (shortname = fgvsrom)





*********************************
Study 3b
*********************************

*participants

FREQUENCIES sex. 
DESCRIPTIVES vars age.

*acq_2.0 = friendship jealousy at prospective loss of acquaintance to same-sex stranger
*cfss_2 = friendship jealousy at prospective loss of close friend to same-sex stranger
 *cfmate_2 = friendship jealousy at prospective loss of close friend to new mate
*bfss_2 = friendship jealousy at prospective loss of best friend to same-sex stranger
*bfos_2 = friendship jealousy at prospective loss of best friend to other-sex stranger
*bfstmate_2 = friendship jealousy at prospective loss of best friend to short-term mate
*bfltm_2 = friendship jealousy at prospective loss of best friend to long-term mate

GLM  acq_2.0 cfss_2 cfmate_2 bfss_2 bfos_2 bfstmate_2 bfltm_2
  /WSFACTOR=relationships 7 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*when interlopers were same-sex strangers
GLM  acq_2.0 cfss_2 bfss_2 
  /WSFACTOR=relationships 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*same- vs. other-sex stranger
GLM  bfss_2 bfos_2 
  /WSFACTOR=relationships 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*when interlopers are stangers versus new mates

*GLM  bfss_2 bfstmate_2 bfltm_2
  /WSFACTOR=relationships 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*GLM  bfss_2 bfstmate_2
  /WSFACTOR=relationships 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*GLM  bfss_2  bfltm_2
  /WSFACTOR=relationships 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*GLM   bfstmate_2 bfltm_2
  /WSFACTOR=relationships 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.

*GLM  cfss_2 cfmate_2 
  /WSFACTOR=relationships 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(relationships)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(relationships) COMPARE adj(lsd)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=relationships.



*********************************
Study 4
*********************************

*participants

FREQUENCIES sex. 
DESCRIPTIVES vars age.

*Included participants passing two data checks*

USE ALL.
COMPUTE filter_$=(check1=1 & check2=2).
VARIABLE LABELS filter_$ 'check1=1 & check2=2 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.
DESCRIPTIVES vars age.

*condition: 
0 = best friend + same-sex stranger
1 = best friend + own close friend
2 = best friend + new romantic partner
3 = own mate + interloper

recode bfss_2 (1 thru hi = 0) into condition. 
recode bfcf2_2 (1 thru hi = 1) into condition. 
recode bfnm_2 (1 thru hi = 2) into condition. 
recode mate_2 (1 thru hi = 3) into condition. 
EXECUTE.


*compute reactions

compute jealousy=sum(bfss_2, bfcf2_2, bfnm_2, mate_2).
compute anger=sum(bfss_3, bfcf2_3, bfnm_3, mate_3).
compute sad=sum(bfss_4, bfcf2_4, bfnm_4, mate_4).
compute afraid=sum(bfss_5, bfcf2_5, bfnm_5, mate_5).
compute pride=sum(bfss_6, bfcf2_6, bfnm_6, mate_6).
compute pity=sum(bfss_7, bfcf2_7, bfnm_7, mate_7).
EXECUTE.

*focal ANOVA: omnibus test

UNIANOVA jealousy BY condition
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PLOT=PROFILE(condition)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(condition) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=condition.



*********************************
Study 5a
*********************************

*participants

use all.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*Included participants*

USE ALL.
COMPUTE filter_$=(bots=1).
VARIABLE LABELS filter_$ 'bots=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES sex.
DESCRIPTIVES age.

*because we report data separated by sex, 
and because we used sex to determine the bot check pass/fail,
we do not look at the small subsample of participants not reporting
their biological sexes (n=3)
*to filter out those participants' data use the filter below

USE ALL.
COMPUTE filter_$=(bots=1 & sex<=3).
VARIABLE LABELS filter_$ 'bots=1 & sex<=3 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES sex.
DESCRIPTIVES age.


*frequencies of events

FREQUENCIES  bfbf bfrom bfacq.
sort cases by sex.
split file by sex.
FREQUENCIES  bfbf bfrom bfacq.
split file off.


*replacement threat

GLM bfbfr_1  bfromr_1  bfacqr_1 
  /WSFACTOR=replacethreat 3 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(replacethreat) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ OPOWER 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=replacethreat .

*time threat

GLM bfbft_1 bfromt_1  bfacqt_1
  /WSFACTOR=timethreat 3 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(timethreat) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ OPOWER 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=timethreat .

*focal ANOVA for friendship jealousy

GLM bfbfj_1 bfromj_1  bfacqj_1
  /WSFACTOR=jealousy 3 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(jealousy) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ OPOWER 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=jealousy .



*MEMORE - mediation
M variables:  replacement (bfbfr_1  bfromr_1) time (bfbft_1 bfromt_1) 
Y variables: jealousy (bfbfj_1 bfromj_1)



*********************************
Study 5b
*********************************

*participants

use all.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*Included participants*

USE ALL.
COMPUTE filter_$=(bots=1).
VARIABLE LABELS filter_$ 'bots=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES sex.
DESCRIPTIVES age.


*frequencies of events

FREQUENCIES  bfbf bfrom bfacq.
sort cases by sex.
split file by sex.
FREQUENCIES  bfbf bfrom bfacq.
split file off.

*replacement threat


compute replacerom=mean(bfromr_1, Q47_1).
compute replacebf=mean(bfbfr_1, Q48_1 ).
compute replaceacq=mean(bfacqr_1, Q48_1.0 ).
EXECUTE.

RELIABILITY
  /VARIABLES= bfromr_1, Q47_1
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES= bfbfr_1, Q48_1
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES= bfacqr_1, Q48_1.0
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.


*replacement threat

glm  replacebf replacerom replaceacq
  /WSFACTOR=target 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(target)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(target) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=target.


*time threat

GLM q52_1 q50_1  q54_1 
  /WSFACTOR=target 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(target)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(target) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=target.


*focal ANOVA for friendship jealousy

GLM bfbfj_1  bfromj_1 bfacqj_1
  /WSFACTOR=reactivity 3 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(reactivity)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(reactivity) COMPARE ADJ(LSD)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=reactivity.



*MEMORE - mediation - does replacement vs. time threat drive friendship jealousy?
*compute short names for MEMORE

compute r_rom=1*replacerom.
compute r_bf=1*replacebf.
EXECUTE.

*M variables:  replacement (r_bf r_rom) time (q52_1 q50_1) 
*Y variables: jealousy (bfbfj_1 bfromj_1)


****Friend-guarding behavior
**compute tactics for each target
*BEST FRIEND + ROMANTIC PARTNER

*vigilance

RELIABILITY
  /VARIABLES=bfromFG_1 bfromFG_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute vigilanceROM=mean(bfromFG_1 , bfromFG_2 ).

*separation

RELIABILITY
  /VARIABLES=bfromFG_3 bfromFG_4 bfromFG_5  bfromFG_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute separationROM=mean(bfromFG_3 ,bfromFG_4 ,bfromFG_5 , bfromFG_8).
EXECUTE.

*make jealous

RELIABILITY
  /VARIABLES= bfromFG_9 
    bfromFG_10 bfromFG_11 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute makejealousyROM=mean(bfromFG_9 ,bfromFG_10 ,bfromFG_11 ).
    

*self/commitment enhancements

RELIABILITY
  /VARIABLES= bfromFG_26  bfromFG_27 bfromFG_28 bfromFG_29 
    bfromFG_30 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute enhancementROM=mean(bfromFG_26,  bfromFG_27, bfromFG_28, bfromFG_29, bfromFG_30 ).

*possession

RELIABILITY
  /VARIABLES=bfromFG_31 bfromFG_32 bfromFG_33 bfromFG_34 bfromFG_35 bfromFG_36 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute possessionROM=mean(bfromFG_31, bfromFG_32, bfromFG_33, bfromFG_34, bfromFG_35, bfromFG_36).


*BEST FRIEND + FRIEND


*vigilance

RELIABILITY
  /VARIABLES=bfbfFG_1 bfbfFG_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute vigilanceBF=mean(bfbfFG_1 , bfbfFG_2 ).

*separation

RELIABILITY
  /VARIABLES=bfbfFG_3 bfbfFG_4 bfbfFG_5  bfbfFG_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute separationBF=mean(bfbfFG_3 ,bfbfFG_4 ,bfbfFG_5 , bfbfFG_8).
EXECUTE.


*make jealous

RELIABILITY
  /VARIABLES= bfbfFG_9 
    bfbfFG_10 bfbfFG_11 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute makejealousyBF=mean(bfbfFG_9 ,bfbfFG_10 ,bfbfFG_11 ).


*self/commitment enhancements

RELIABILITY
  /VARIABLES= bfbfFG_26  bfbfFG_27 bfbfFG_28 bfbfFG_29 
    bfbfFG_30 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute enhancementBF=mean(bfbfFG_26,  bfbfFG_27, bfbfFG_28, bfbfFG_29, bfbfFG_30 ).

*possession

RELIABILITY
  /VARIABLES=bfbfFG_31 bfbfFG_32 bfbfFG_33 bfbfFG_34 bfbfFG_35 bfbfFG_36 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute possessionBF=mean(bfbfFG_31, bfbfFG_32, bfbfFG_33, bfbfFG_34, bfbfFG_35, bfbfFG_36).


*BEST FRIEND + ACQUAINTANCE


*vigilance

RELIABILITY
  /VARIABLES=bfacqFG_1 bfacqFG_2 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute vigilanceACQ=mean(bfacqFG_1 , bfacqFG_2 ).

*separation

RELIABILITY
  /VARIABLES=bfacqFG_3 bfacqFG_4 bfacqFG_5  bfacqFG_8
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute separationACQ=mean(bfacqFG_3 ,bfacqFG_4 ,bfacqFG_5 , bfacqFG_8).
EXECUTE.


*make jealous

RELIABILITY
  /VARIABLES= bfacqFG_9 
    bfacqFG_10 bfacqFG_11 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute makejealousyACQ=mean(bfacqFG_9 ,bfacqFG_10 ,bfacqFG_11 ).


*self/commitment enhancements

RELIABILITY
  /VARIABLES= bfacqFG_26  bfacqFG_27 bfacqFG_28 bfacqFG_29 
    bfacqFG_30 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute enhancementACQ=mean(bfacqFG_26,  bfacqFG_27, bfacqFG_28, bfacqFG_29, bfacqFG_30 ).

*possession

RELIABILITY
  /VARIABLES=bfacqFG_31 bfacqFG_32 bfacqFG_33 bfacqFG_34 bfacqFG_35 bfacqFG_36 
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
compute possessionACQ=mean(bfacqFG_31, bfacqFG_32, bfacqFG_33, bfacqFG_34, bfacqFG_35, bfacqFG_36).


*tactic reliability

RELIABILITY
  /VARIABLES=vigilanceROM vigilanceBF vigilanceACQ
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=separationROM separationBF separationACQ
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=makejealousyROM makejealousyBF makejealousyACQ
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=enhancementROM enhancementBF enhancementACQ
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.
RELIABILITY
  /VARIABLES=possessionROM possessionBF possessionACQ
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

**compute friend guarding overall

compute fgvsrom=mean(vigilanceROM, separationROM , makejealousyROM ,
    enhancementROM, possessionROM).
compute fgvsf=mean( vigilanceBF ,separationBF ,
 makejealousyBF, enhancementBF
   , possessionBF).
compute fgvsacq=mean(vigilanceACQ ,separationACQ ,
   makejealousyACQ, enhancementACQ ,
    possessionACQ ).
EXECUTE.

RELIABILITY
  /VARIABLES=vigilanceROM, separationROM , makejealousyROM ,
    enhancementROM, possessionROM vigilanceBF ,separationBF ,
 makejealousyBF, enhancementBF, vigilanceACQ ,separationACQ ,
   makejealousyACQ, enhancementACQ ,
    possessionACQ 
   , possessionBF
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

*targets (1=same-sex friend, 2 = romantic partner, 3= acquaintance)
*tactics (1=vigilance, 2=separation, 3=induce jealousy, 4=enhancement, 5=possession)

GLM vigilanceBF separationBF makejealousyBF enhancementBF possessionBF vigilanceROM separationROM 
    makejealousyROM enhancementROM possessionROM vigilanceACQ separationACQ makejealousyACQ 
    enhancementACQ possessionACQ
  /WSFACTOR=targets 3 Polynomial tactics 5 Polynomial 
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(targets) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(tactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(targets*tactics) compare (targets)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=targets tactics targets*tactics.


*Mediation via MEMORE - do interlopers who are same-sex friends (not acquaintances) evoke greater friendship jealousy,
and thus greater friend guarding, than do interlopers who are romantic partners?
M variables: jealousy (bfbfj_1 bfromj_1)
Y variables: friend guarding (fgvsf fgvsrom)


**EXPLORATORY WORK ON RETENTION

*MCNemar tests

CROSSTABS
  /TABLES=bfacq_retain BY bfbf_retain
  /FORMAT=AVALUE TABLES
  /STATISTICS=MCNEMAR 
  /CELLS=COUNT
  /COUNT ROUND CELL.
CROSSTABS
  /TABLES=bfacq_retain BY bfr_retain
  /FORMAT=AVALUE TABLES
  /STATISTICS=MCNEMAR 
  /CELLS=COUNT
  /COUNT ROUND CELL.
CROSSTABS
  /TABLES=bfbf_retain BY bfr_retain
  /FORMAT=AVALUE TABLES
  /STATISTICS=MCNEMAR 
  /CELLS=COUNT
  /COUNT ROUND CELL.

*does friend-guaridng behavior amount predict successful friend retention?

LOGISTIC REGRESSION VARIABLES bfbf_retain
  /METHOD=ENTER fgvsf
  /CRITERIA=PIN(.05)  POUT(.10) ITERATE(20) CUT(.5)
/PRINT ci.

LOGISTIC REGRESSION VARIABLES bfr_retain
  /METHOD=ENTER fgvsrom
  /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5)
/PRINT ci.

LOGISTIC REGRESSION VARIABLES bfacq_retain
  /METHOD=ENTER fgvsacq
  /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5)
/PRINT ci.

*correlations among tactics and logistic regressions using all tactics to predict retention (requested by AE)
*CORRELATIONS
  /VARIABLES=vigilanceBF ,separationBF ,
 makejealousyBF, enhancementBF
   , possessionBF
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.
*CORRELATIONS
  /VARIABLES=vigilanceROM, separationROM , makejealousyROM ,
    enhancementROM, possessionROM
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.
*CORRELATIONS
  /VARIABLES=vigilanceACQ ,separationACQ ,
   makejealousyACQ, enhancementACQ ,
    possessionACQ
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.
*LOGISTIC REGRESSION VARIABLES bfbf_retain
  /METHOD=ENTER vigilanceBF ,separationBF ,
 makejealousyBF, enhancementBF
   , possessionBF
  /CRITERIA=PIN(.05)  POUT(.10) ITERATE(20) CUT(.5)
/PRINT ci.
*LOGISTIC REGRESSION VARIABLES bfr_retain
  /METHOD=ENTER vigilanceROM, separationROM , makejealousyROM ,
    enhancementROM, possessionROM
  /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5)
/PRINT ci.
*LOGISTIC REGRESSION VARIABLES bfacq_retain
  /METHOD=ENTER vigilanceACQ ,separationACQ ,
   makejealousyACQ, enhancementACQ ,
    possessionACQ
  /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5)
/PRINT ci.


*Mediation via PROCESS Model 4  *w 90 bias-correct CI* - to explore whether friendship jealousy predicts 
friend retention, as mediated by friend guarding [[exploratory, requested by AE]]
X variable: friendship jealousy when best friend + same-sex friends (bfbfj_1)
M variable: friend guarding versus same-sex  friend (fgvsf)
Y variable: freind retentionversus same-sex  friend (bfbf_retain)



*********************************
*Study 6
*********************************

use all.
FREQUENCIES q5.

*participants - include those passing checks

USE ALL.
COMPUTE filter_$=(botcheck = 1 & Q40 =4).
VARIABLE LABELS filter_$ 'botcheck = 1 & Q40 =4 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES q5.
DESCRIPTIVES vars q7.


**focal ANOVA for manipulation check

*control.jealous: 0 = control, 1 = jealous
*manipcheck_1 = jealousy, _2= neutral, 3=happy, 4=sad, 5=anger

GLM manipcheck_1 manipcheck_2 manipcheck_3 manipcheck_4 manipcheck_5 BY control.jealous
  /WSFACTOR=affect 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(affect*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(affect) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*affect) compare (control.jealous)
  /EMMEANS=TABLES(control.jealous*affect) compare (affect)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=affect 
  /DESIGN=control.jealous.


**compute friendship maintenance

compute vigilance=mean(fg_1, fg_2).
RELIABILITY
  /VARIABLES=fg_1, fg_2
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute monopolizarion=mean(fg_8, fg_9).
RELIABILITY
  /VARIABLES= fg_8, fg_9,
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute inducej=mean(fg_10, fg_11, fg_12, fg_13). 
RELIABILITY
  /VARIABLES=  fg_10, fg_11, fg_12, fg_13
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute possess=mean(fg_14, fg_15, fg_16, fg_17).
RELIABILITY
  /VARIABLES=fg_14, fg_15, fg_16, fg_17
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute friendguard=mean(fg_1, fg_2, fg_8, fg_9, fg_10, fg_11, fg_12, fg_13, fg_14, fg_15, fg_16, fg_17).
RELIABILITY
  /VARIABLES=fg_1, fg_2, fg_8, fg_9, fg_10, fg_11, fg_12, fg_13, fg_14, fg_15, fg_16, fg_17
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

compute everydayretetnion=mean(fg_3, fg_4, fg_5, fg_6, fg_7).
RELIABILITY
  /VARIABLES=fg_3, fg_4, fg_5, fg_6, fg_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

**focal ANOVA for friendship maintenance
compute everydayretetnion2=mean(fg_3, fg_4, fg_5,  fg_7).
RELIABILITY
  /VARIABLES=fg_3, fg_4, fg_5,  fg_7
  /SCALE('ALL VARIABLES') ALL
  /MODEL=ALPHA.

GLM friendguard everydayretetnion BY control.jealous
  /WSFACTOR=intent 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(intent*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(intent) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*intent) compare (intent)
  /EMMEANS=TABLES(control.jealous*intent) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=intent 
  /DESIGN=control.jealous.


*MEDIATION
*mediation PROCESS MODEL 4
x= condition (control.jealous)
m = all affective reactions (manipcheck_1 manipcheck_2 manipcheck_3 manipcheck_4 manipcheck_5)
y = friend guard (friendguard)

*************ancillary analyses

**analysis in subsample 1 (based on self-reported scores)

USE ALL.
COMPUTE filter_$=(botcheck = 1 & Q40 =4 & includeinb1=1).
VARIABLE LABELS filter_$ 'botcheck = 1 & Q40 =4 & includeinb1=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES q5.

sort cases by control.jealous.
split file SEPARATE by control.jealous.
DESCRIPTIVES vars manipcheck_1 manipcheck_2 manipcheck_3 manipcheck_4 manipcheck_5.
split file off.

*GLM manipcheck_1 manipcheck_2 manipcheck_3 manipcheck_4 manipcheck_5 BY control.jealous
  /WSFACTOR=affect 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(affect*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(affect) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*affect) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=affect 
  /DESIGN=control.jealous.

GLM friendguard everydayretetnion BY control.jealous
  /WSFACTOR=intent 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(intent*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(intent) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*intent) compare (intent)
  /EMMEANS=TABLES(control.jealous*intent) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=intent 
  /DESIGN=control.jealous.

*GLM vigilance monopolizarion inducej possess everydayretetnion BY control.jealous
  /WSFACTOR=tactics 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(tactics*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(tactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*tactics) compare (tactics)
  /EMMEANS=TABLES(control.jealous*tactics) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=tactics 
  /DESIGN=control.jealous.


**analysis in subsample s (based on RA-coded scores)


USE ALL.
COMPUTE filter_$=(botcheck = 1 & Q40 =4 & includeinb2=1).
VARIABLE LABELS filter_$ 'botcheck = 1 & Q40 =4 & includeinb2=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES q5.

sort cases by control.jealous.
split file SEPARATE by control.jealous.
DESCRIPTIVES vars RA_jea RA_neu RA_hap RA_sad RA_ang .
split file off.


CORRELATIONS
  /VARIABLES=RA_jea RA_neu RA_hap RA_sad RA_ang 
manipcheck_1 manipcheck_2 manipcheck_3 manipcheck_4 manipcheck_5
  /PRINT=TWOTAIL NOSIG
  /MISSING=PAIRWISE.

*GLM manipcheck_1 manipcheck_2 manipcheck_3 manipcheck_4 manipcheck_5 BY control.jealous
  /WSFACTOR=affect 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(affect*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(affect) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*affect) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=affect 
  /DESIGN=control.jealous.

GLM friendguard everydayretetnion BY control.jealous
  /WSFACTOR=intent 2 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(intent*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(intent) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*intent) compare (intent)
  /EMMEANS=TABLES(control.jealous*intent) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=intent 
  /DESIGN=control.jealous.

*GLM vigilance monopolizarion inducej possess everydayretetnion BY control.jealous
  /WSFACTOR=tactics 5 Polynomial 
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(tactics*control.jealous)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(control.jealous) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(tactics) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(control.jealous*tactics) compare (tactics)
  /EMMEANS=TABLES(control.jealous*tactics) compare (control.jealous)
  /PRINT=DESCRIPTIVE ETASQ 
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=tactics 
  /DESIGN=control.jealous.


*********************************
*Study 7
*********************************

use all.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*include all those responding to the jealousy DV*

USE ALL.
COMPUTE filter_$=(jealous>=1).
VARIABLE LABELS filter_$ 'jealous>=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

FREQUENCIES sex. 
DESCRIPTIVES vars age.

*compute reactions

compute happy=sum(
male_hiT_controlA_1,
female_hiT_controlA_1,
male_hiT_hiA_1,
female_hiT_hiA_1,
male_hiT_loA_1,
female_hiT_loA_1,
male_loT_controlA_1,
female_loT_controlA_1,
male_loT_hiA_1,
female_loT_hiA_1,
male_loT_loA_1,
female_loT_loA_1).
EXECUTE.

compute jealous=sum(
male_hiT_controlA_2,
female_hiT_controlA_2,
male_hiT_hiA_2,
female_hiT_hiA_2,
male_hiT_loA_2,
female_hiT_loA_2,
male_loT_controlA_2,
female_loT_controlA_2,
male_loT_hiA_2,
female_loT_hiA_2,
male_loT_loA_2,
female_loT_loA_2).

compute disgusted=sum(
male_hiT_controlA_3,
female_hiT_controlA_3,
male_hiT_hiA_3,
female_hiT_hiA_3,
male_hiT_loA_3,
female_hiT_loA_3,
male_loT_controlA_3,
female_loT_controlA_3,
male_loT_hiA_3,
female_loT_hiA_3,
male_loT_loA_3,
female_loT_loA_3).

compute angry=sum(
male_hiT_controlA_4,
female_hiT_controlA_4,
male_hiT_hiA_4,
female_hiT_hiA_4,
male_hiT_loA_4,
female_hiT_loA_4,
male_loT_controlA_4,
female_loT_controlA_4,
male_loT_hiA_4,
female_loT_hiA_4,
male_loT_loA_4,
female_loT_loA_4).


compute sad=sum(
male_hiT_controlA_5,
female_hiT_controlA_5,
male_hiT_hiA_5,
female_hiT_hiA_5,
male_hiT_loA_5,
female_hiT_loA_5,
male_loT_controlA_5,
female_loT_controlA_5,
male_loT_hiA_5,
female_loT_hiA_5,
male_loT_loA_5,
female_loT_loA_5).


compute proud=sum(
male_hiT_controlA_6,
female_hiT_controlA_6,
male_hiT_hiA_6,
female_hiT_hiA_6,
male_hiT_loA_6,
female_hiT_loA_6,
male_loT_controlA_6,
female_loT_controlA_6,
male_loT_hiA_6,
female_loT_hiA_6,
male_loT_loA_6,
female_loT_loA_6).


compute guilty=sum(
male_hiT_controlA_7,
female_hiT_controlA_7,
male_hiT_hiA_7,
female_hiT_hiA_7,
male_hiT_loA_7,
female_hiT_loA_7,
male_loT_controlA_7,
female_loT_controlA_7,
male_loT_hiA_7,
female_loT_hiA_7,
male_loT_loA_7,
female_loT_loA_7).


compute relieved=sum(
male_hiT_controlA_8,
female_hiT_controlA_8,
male_hiT_hiA_8,
female_hiT_hiA_8,
male_hiT_loA_8,
female_hiT_loA_8,
male_loT_controlA_8,
female_loT_controlA_8,
male_loT_hiA_8,
female_loT_hiA_8,
male_loT_loA_8,
female_loT_loA_8).


compute enthusiastic=sum(
male_hiT_controlA_9,
female_hiT_controlA_9,
male_hiT_hiA_9,
female_hiT_hiA_9,
male_hiT_loA_9,
female_hiT_loA_9,
male_loT_controlA_9,
female_loT_controlA_9,
male_loT_hiA_9,
female_loT_hiA_9,
male_loT_loA_9,
female_loT_loA_9).


compute nothing=sum(
male_hiT_controlA_10,
female_hiT_controlA_10,
male_hiT_hiA_10,
female_hiT_hiA_10,
male_hiT_loA_10,
female_hiT_loA_10,
male_loT_controlA_10,
female_loT_controlA_10,
male_loT_hiA_10,
female_loT_hiA_10,
male_loT_loA_10,
female_loT_loA_10).
EXECUTE.

*compute conditions
**alliance (NOTE = "alliance" is replacement threat: -1 = low, 0 = no-information control, 1 = high

recode male_hiT_controlA_1
female_hiT_controlA_1 male_loT_controlA_1,
female_loT_controlA_1 (1 thru hi= 0) into alliance alliance alliance alliance.
EXECUTE.

recode male_hiT_hiA_1
female_hiT_hiA_1 male_loT_hiA_1,
female_loT_hiA_1 (1 thru hi= 1) into alliance alliance alliance alliance.
EXECUTE.

recode male_hiT_loA_1
female_hiT_loA_1 male_loT_loA_1,
female_loT_loA_1 (1 thru hi= -1) into alliance alliance alliance alliance.
EXECUTE.

**time threat: 0 = low, 1= high

recode male_hiT_controlA_1 female_hiT_controlA_1 
male_hiT_hiA_1 female_hiT_hiA_1
male_hiT_loA_1 female_hiT_loA_1
(1 thru hi= 1) into time time time time time time.
EXECUTE.

recode male_loT_controlA_1 female_loT_controlA_1 
male_loT_hiA_1 female_loT_hiA_1
male_loT_loA_1 female_loT_loA_1
(1 thru hi= 0) into time time time time time time.
EXECUTE.


*focal ANOVA for friendship jelaousy

UNIANOVA jealous BY alliance time
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PLOT=PROFILE(alliance*time time*alliance)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(alliance) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(time) COMPARE ADJ(LSD)
  /EMMEANS=TABLES(alliance*time) compare (alliance)
  /EMMEANS=TABLES(alliance*time) compare (time)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=alliance time alliance*time.

*********************************
Study 8a
*********************************

*participants

use all.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*include those passing first check*


USE ALL.
COMPUTE filter_$=(attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*to include those passing the latter check*

USE ALL.
COMPUTE filter_$=(attneth=1).
VARIABLE LABELS filter_$ 'attneth=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

*to indlude those passing both checks*

USE ALL.
COMPUTE filter_$=(attneth=1 & attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 & attn1=1(FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

*code replacement threat conditions (low replacment threat instantiated by romantic partner = 0; high replacment threat instantiated by friend = 1)

recode maleprompt (1=1) into rom.friend.
recode malecontrol (1=0) into rom.friend.
recode femaleprompt (1=1) into rom.friend.
recode femalecontrol (1=0) into rom.friend.
EXECUTE.


*focal ANOVA for friendship jealousy

UNIANOVA Q86_4 BY rom.friend 
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PLOT=PROFILE(rom.friend)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(rom.friend) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN= rom.friend.


*chosen separation

compute maledistance=abs(mike-bfmaletarget).
compute femaledistance=ABS(sarah-fbffemaletarget).
compute distance=sum(maledistance, femaledistance).
recode distance (0=sysmis). 
EXECUTE.

UNIANOVA distance BY rom.friend
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(rom.friend) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=rom.friend.

*MEDIATION: PROCESS Model 4
X: condition (rom.friend)
M: friendship jealousy (Q86_4)
Y: chosen seating distance (distance)


*********************************
Study 8b
*********************************

*participants

use all.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*include those passing first check*


USE ALL.
COMPUTE filter_$=(attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex. 
DESCRIPTIVES vars age.

*to include those passing the latter check*
USE ALL.
COMPUTE filter_$=(attneth=1).
VARIABLE LABELS filter_$ 'attneth=1 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

*to indlude those passing both checks*
USE ALL.
COMPUTE filter_$=(attneth=1 & attn1=1).
VARIABLE LABELS filter_$ 'attneth=1 & attn1=1(FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.
FREQUENCIES sex.


*coding conditions: 0 = low replacement threat (best friend picks you over new friend), 1 = high replacement threat (best friend picks new friend over you)

recode maleloRT (1=0) into RTlo.hi.
recode malehiRT (1=1) into RTlo.hi.
recode femaleloRT (1=0) into RTlo.hi.
recode femalehiRT (1=1) into RTlo.hi.
EXECUTE.


*focal ANOVA for friendship jealousy

UNIANOVA Q86_4 BY RTlo.hi 
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /PLOT=PROFILE(RTlo.hi)
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(RTlo.hi) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN= RTlo.hi.



*compute chosen separation

compute maledistance=abs(mike-bfmaletarget).
compute femaledistance=ABS(sarah-fbffemaletarget).
compute distance=sum(maledistance, femaledistance).
recode distance (0=sysmis). 
EXECUTE.

UNIANOVA distance BY RTlo.hi
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(OVERALL) 
  /EMMEANS=TABLES(RTlo.hi) COMPARE ADJ(LSD)
  /PRINT=ETASQ DESCRIPTIVE
  /CRITERIA=ALPHA(.05)
  /DESIGN=RTlo.hi.


*MEDIATION: PROCESS Model 4
X: condition (RTlo.hi)
M: jealousy (Q86_4)
Y: chosen seating distance (distance)


